All Functions of Week 9

scale_x_continuous

{GGPLOT2}

Customise continuous x axis

geom_line

{GGPLOT2}

Generates a line

max

{base}

Get maximum of a vector

stat_ecdf

{GGPLOT2}

Compute empirical cumulative distribution

data.frame

{base}

Create a data.frame from vectors

aes

{GGPLOT2}

Construct aesthetic mapping of a ggplot graph

sapply

{base}

Apply a function over a vector or list and simplify the result

pwr.t.test

{pwr}

Calculate power, sample size, or effect size for t-tests

library

{base}

Load an R package

prop.test

{stats}

Test of Equal or Given Proportions

round

{base}

Rounds numbers

theme_minimal

{GGPLOT2}

A minimalistic theme with no background annotations

geom_hline

{GGPLOT2}

Add a horizontal line in GGPLOT2

ggplot

{GGPLOT2}

Create a ggplot graph

expression

{base}

Used in plots to add symbols to axes

set.seed

{base}

Initialise a pseudorandom number generator.

geom_histogram

{GGPLOT2}

Generates a histogram

cat

{base}

Concatenate and print objects to the console without quotes or indices

sd

{stats}

Get standard deviation of a vector

rnorm

{base}

Generate random numbers from a normal distribution

mean

{base}

Get mean of a vector

table

{base}

Obtain frequency table of a variable/cross-tabulation of two variables

tibble

{tibble}

A modern data frame from the tidyverse

ls

{base}

Return a vector of character strings giving the names of the objects in the specified environment

qt

{stats}

Quantile function for t-distribution

sqrt

{base}

Square-root function

ifelse

{base}

Return a or b depending on the value of test

geom_abline

{GGPLOT2}

Add a reference line with a given slope and intercept

coord_cartesian

{GGPLOT2}

Zoom into a plot region without removing data (set Cartesian axis limits)

read.csv

{utils}

Read a csv file to data frame. Specify stringsAsFactors = FALSE to keep all string columns as characters

sprintf

{base}

C-style formatted string printing

exists

{base}

Test whether a named object/variable exists

setwd

{base}

Set Working Directory

ceiling

{base}

Round numbers up to the smallest following integer

cut

{base}

Convert Numeric to Factor

c

{base}

Combine values/vectors into a vector

complete.cases

{stats}

Find Complete Cases

t.test

{stats}

Performs one and two sample t-tests on vectors of data.

pt

{stats}

Calculate the cumulative distribution function of the t-distribution

power.t.test

{stats}

Power calculations for one- and two-sample t-tests

with

{base}

evaluate expression in the context of a data frame

labs

{GGPLOT2}

Customise labels in GGPLOT2

scale_y_continuous

{GGPLOT2}

Customise continuous y axis

median

{stats}

Get median of a vector

replicate

{base}

Repeatedly evaluate an expression (wrapper around sapply)

mutate

{dplyr}

Create new variables

rm

{base}

Remove objects

The end!